/*********************/
#include <stdio.h>
#include "insort_way.h"
#include "freeGLlogo.h"
#include "data_struct.h"

int test_insort()
{
	int a[]={9,3,5,6,2,1,8,7,4};
	int cmd=0;
	print_arry(a,9);
	while(1)
	{
		int a[]={9,3,5,6,2,1,8,7,4};
		printf("1.insert_sort\n");
		printf("2.shell_sort\n");
		printf("3.bubble_sort\n");
		printf("4.quick_sort\n");
		printf("5.select_sort\n");
		printf("6.heap_sort\n");
		printf("Please choose a way to sort.\n");
		scanf("%d",&cmd);
		printf("cmd=%d\n",cmd);
		printf("-------------RESULT--------------\n");
		print_arry(a,9);
		switch(cmd)
		{
			case 1:
				insert_sort(a,9);
				break;
			case 2:
				shell_sort(a,9);
				break;
			case 3:
				bubble_sort(a,9);
				break;
			case 4:
				printf("this is quick_sort\n");
				quick_sort(a,0,8);
				break;
			case 5:
				printf("this is select_sort\n");
				select_sort(a, 9);
				break;
			case 6:
				printf("this is heap_sort\n");
				heap_sort(a,9);
			default:
				break;	
		}
		print_arry(a,9);
		printf("------------END-----------------\n");
	}

}

int test_list()
{
	s_list * slist = NULL;
	slist = s_list_create();
	s_list_addnode(slist,"1xdwadaw");
	s_list_addnode(slist,"2xdwadaw");
	s_list_addnode(slist,"3xdwadaw");
	s_list_addnode(slist,"4xdwadaw");
	s_list_addnode(slist,"5xdwadaw");
	s_list_print(slist);
	s_list_term(slist);
	//s_list_print(slist);
	
	return 0;
}

int main()
{
	freegl_logo();
	printf("welcome to FreeGL!\n");
	printf("---------FreeGL----------\n");
	//test_insort();
	test_list();
	return 0;	
}


